export function getType(data) {
  const getType = Object.prototype.toString
  const typeStr = getType.call(data)
  const type = typeStr.split(' ')[1].replace(/]$/g, '')
  return type.toLowerCase()
}

function type(data) {
  const getType = Object.prototype.toString
  return getType.call(data)
}

export const isNum = data => type(data) === '[object Number]'
export const isStr = data => type(data) === '[object String]'
export const isArr = data => type(data) === '[object Array]'
export const isObj = data => type(data) === '[object Object]'
export const isUnd = data => type(data) === '[object Undefined]'
export const isFun = data => type(data) === '[object Function]'
export const isNul = data => type(data) === '[object Null]'
export const isBoo = data => type(data) === '[object Boolean]'
